﻿Public Class TimerExists
  Public Event CancelClicked()

  Public Sub New()
    InitializeComponent()
  End Sub

  Public Sub New(ByVal dt As Date)
    Me.New()

    If dt.Subtract(Date.Now).TotalHours >= 24 Then
      Me.Label1.Text = "The normal profile will be restored at " & dt.ToShortTimeString & " on " & dt.ToShortDateString & "."
    Else
      Me.Label1.Text = "The normal profile will be restored at " & dt.ToShortTimeString & "."
    End If
  End Sub

  Private Sub WP7Button1_MouseDown(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WP7Button1.MouseDown
    RaiseEvent CancelClicked()
  End Sub

  Public Property CancelButtonEnabled() As Boolean
    Get
      Return Me.WP7Button1.Enabled
    End Get
    Set(ByVal value As Boolean)
      Me.WP7Button1.Enabled = value
      Me.Invalidate()
    End Set
  End Property
End Class
